package com.example.bookmall.entity;


import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("book")
//@Schema(name = "图书信息")
public class Book {
    @TableId(type = IdType.AUTO)
    private Integer bookId;

    private Integer categoryId;

    //书名
    private String title;

    private String author;

    //出版社
    private String publisher;

    private String isbn;

    private BigDecimal price;

    //库存
    private Integer stock;

    //简介
    private String description;

    //封面图片地址
    private String coverUrl;

    //图书状态（0 = 下架，1 = 上架）
    private Integer status;

    //是否为推荐书籍 1 = 不推荐，2 = 推荐
    @TableField("is_recommended")
    private Integer isRecommended;

    //是否为轮播图书籍 1 = 不轮播，2 = 轮播
    @TableField("is_banner")
    private Integer isBanner;

    //上架时间
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    private Integer deleted; // 逻辑删除字段
}